# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=yj
pkgver=1.2.2
pkgrel=0
pkgdesc="Command line tool that converts YAML to JSON"
url="https://github.com/bruceadams/yj"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le"  # limited by rust/cargo
license="Apache-2.0"
makedepends="cargo"
source="https://github.com/bruceadams/yj/archive/v$pkgver/yj-$pkgver.tar.gz"
options="!check"  # no tests provided

export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_LTO="true"
export CARGO_PROFILE_RELEASE_OPT_LEVEL="s"
export CARGO_PROFILE_RELEASE_PANIC="abort"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	cargo build --release --frozen
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
b288c48bbee2a3af4bfd65d29c5a647cfa223a05ae71446b2da16b00c86fed946ede660f073cf19f31407e0c1ecb1e03fb72b75825d59c6e8e91e3e9e6b6fc3f  yj-1.2.2.tar.gz
"
